home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.2 Development Libraries / SGI IRIX 6.2 Development Libraries.iso / relnotes / gl_dev / ch7.z / ch7
Encoding:
Text File  |  1997-09-04  |  12.0 KB  |  397 lines

  1.  
  2.  
  3.  
  4.                                   - 1 -
  5.  
  6.  
  7.  
  8.        6.  _P_b_u_f_f_e_r_s__o_n__I_m_p_a_c_t
  9.  
  10.        The OpenGL Pbuffer extension is now supported on all impact
  11.        configurations:  Max Impact, High Impact, and Solid Impact.
  12.        These release notes describe the Impact Pbuffer
  13.        implementation in detail.  This will be of use primarily to
  14.        developers of opengl applications that use pbuffers.
  15.  
  16.  
  17.        6.1  _P_b_u_f_f_e_r__E_x_t_e_n_s_i_o_n_s
  18.  
  19.        Note that you will have to use the FBConfig extension to
  20.        create pbuffers.  Also, if you want to copy between pbuffers
  21.        and windows, you will need to use the MakeCurrentRead
  22.        extension.  This release includes all three extensions:
  23.        Pbuffers, MakeCurrentRead, and FBConfig.
  24.  
  25.  
  26.        6.2  _P_b_u_f_f_e_r__S_i_z_e_s
  27.  
  28.        Each pbuffer allocated consumes a set of bitplanes with the
  29.        same geometry as the entire screen.  So, if you run the
  30.        monitor at 1280x1024, allocating a single buffer will
  31.        actually consume 1280x1024 of offscreen framebuffer memory.
  32.        It is impossible to create a pbuffer larger than the screen
  33.        size.  You can create one smaller, but the remaining screen
  34.        memory will be wasted and cannot be allocated.
  35.  
  36.  
  37.        In some Impact configurations, there are actually multiple
  38.        sets of bitplanes available to pbuffers (pbuffer banks), so
  39.        it is in some cases (e.g. max impact) it is possible to
  40.        allocate more than one pbuffer at a time.  See the section
  41.        below called "Recommended pbuffer and window combinations."
  42.  
  43.  
  44.        6.3  _P_b_u_f_f_e_r__f_o_r_m_a_t_s
  45.  
  46.        This release supports the following pbuffer formats:  All X
  47.        visuals (except overlays) support pbuffers.  This includes
  48.        double buffered, and stereo quad-buffered visuals, and
  49.        visuals with depth and stencil planes.
  50.  
  51.  
  52.        All appear to work fine, and allow copies from pbuffers to
  53.        windows, and windows to pbuffers.  Note that the context
  54.        used to do this copy must be created with the same fbconfig
  55.        as the window (not the pbuffer).  See the "glXMakeCurrent
  56.        compatibility workaround" section below for details.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.                                   - 2 -
  71.  
  72.  
  73.  
  74.        6.4  _g_l_X_M_a_k_e_C_u_r_r_e_n_t__c_o_m_p_a_t_i_b_i_l_i_t_y__r_e_l_a_x_a_t_i_o_n
  75.  
  76.        In this release, glXMakeCurrent's strict compatibility
  77.        requirements have been relaxed for pbuffers (but not for
  78.        windows).  Any context that meets certain very minimal
  79.        requirements can be used to render into a pbuffer, or copy
  80.        from a pbuffer.  The requirements are simply that the window
  81.        and context must have the same renderType; in other words,
  82.        they must both be color index, or rgba.  There are no
  83.        requirements that the color depths of the context match
  84.        those of the pbuffer, or anything of the sort.
  85.  
  86.  
  87.        Note that windows still have strict similarity requirements.
  88.        Contexts and windows bound together with glXMakeCurrent must
  89.        have been created from the same visual.
  90.  
  91.  
  92.        6.5  _g_l_X_M_a_k_e_C_u_r_r_e_n_t__c_o_m_p_a_t_i_b_i_l_i_t_y__w_o_r_k_a_r_o_u_n_d
  93.  
  94.        In order to copy between pbuffers and windows, you will need
  95.        to use the glXMakeCurrentReadSGIX extension.  This is all
  96.        very straightforward if the window, pbuffer, and context you
  97.        are using were all created with the same FBConfigID (using
  98.        glXCreateContextWithConfigSGIX).
  99.  
  100.  
  101.        If they weren't created from the same fbconfigid, things get
  102.        more complicated.  A problem arises since there is a bug in
  103.        the X server which requires that windows (but not pbuffers)
  104.        and contexts be created from the exact same visual (or
  105.        fbconfig).  (This does not follow the spec since the
  106.        fbconfig spec specifies that windows should work with any
  107.        "compatible" context if the context was created from an
  108.        fbconfig.)  You must make sure that the window and context
  109.        were always created with the EXACT SAME fbconfig or visual
  110.        id.  So, to copy from a single buffered pbuffer to a double
  111.        buffered window, you must:
  112.  
  113.  
  114.           +o create an sb pbuffer
  115.  
  116.           +o create a db window
  117.  
  118.           +o create a db context
  119.  
  120.  
  121.        This will allow glXMakeCurrentReadSGIX to work correctly
  122.        around this bug.  Note that the above example would not work
  123.        if the context were created single-buffered.  This is due to
  124.        the fact that makecurrent between the sb context and db
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.                                   - 3 -
  137.  
  138.  
  139.  
  140.        window would fail since the window and context were not
  141.        created with reference to the exact same visual (or
  142.        fbconfig).
  143.  
  144.  
  145.        Note that the db context in the example above may be used
  146.        with makecurrent(pbuffer), makecurrent(window), and
  147.        makecurrentread(window, pbuffer), or
  148.        makecurrentread(pbuffer, window) even though the pbuffer is
  149.        single buffered and the context double buffered.  This is
  150.        correct behavior according to the pbuffer spec.  Window
  151.        behavior should be corrected in a subsequent release so that
  152.        window compatibility is properly tested against contexts.
  153.  
  154.  
  155.        See the section at the end about Impact-specific
  156.        glxMakeCurrentRead Compatibility.
  157.  
  158.  
  159.        6.6  _P_b_u_f_f_e_r__p_e_r_f_o_r_m_a_n_c_e
  160.  
  161.        The single most important thing you can do to insure good
  162.        pbuffer performance on impact is to make sure that the
  163.        windows that your applications are using are not using X
  164.        visuals with Z bitplanes unless absolutely necessary.  There
  165.        are conditions outlined below under "pbuffer bank
  166.        calculations" which cause zbuffers to have to swap into host
  167.        memory when their bank usage conflicts with pbuffers.  The
  168.        simplest way to avoid this is to create all windows using
  169.        visuals without zbuffers.
  170.  
  171.  
  172.        The most expensive operation with pbuffers is actually
  173.        glXMakeCurrentReadSGIX.  Try to minimize your use of this
  174.        routine in order to maximize performance.  In pursuit of
  175.        this goal, you should try to minimize the number of contexts
  176.        you use in your application.
  177.  
  178.  
  179.        6.7  _P_b_u_f_f_e_r__b_a_n_k__c_a_l_c_u_l_a_t_i_o_n_s
  180.  
  181.        In order to calculate how many pbuffers you can have
  182.        concurrently with your windows, use the following procedure.
  183.        Determine how many pbuffer banks are available in your
  184.        system, using the table below called "Pbuffer bank
  185.        availability".  This is the number of pbuffer banks
  186.        available on your system.
  187.  
  188.  
  189.        Now you need to determine how many banks your application
  190.        requires.  Use the table below called "Pbuffer bank usage"
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.                                   - 4 -
  203.  
  204.  
  205.  
  206.        to look up how many banks each of the buffers that your
  207.        application uses requires.  Note that this is a global
  208.        resource, so you must include in your calculations all
  209.        applications running the on the machine.  If another
  210.        application allocates a pbuffer, then there is one fewer
  211.        pbuffer bank available for your application.  Similarly, if
  212.        any application uses a Z buffer, there will not be enough
  213.        pbuffer banks to support a pbuffer at the same time.
  214.  
  215.  
  216.        Pbuffers are capable of sharing the pbuffer banks with Z
  217.        buffers, and the X server supports swapping the pbuffer bank
  218.        when necessary so the bitplanes may be used for both
  219.        purposes at once.  This will incur a substantial performance
  220.        penalty which may be prohibitive for some applications.  In
  221.        other cases where applications are willing to accept
  222.        pbuffer/zbuffer swapping, you may allow a pbuffer to "share"
  223.        bitplanes with a zbuffer in your calculations.  The one
  224.        exception to this sharing is that you cannot use
  225.        glXMakeCurrentReadSGIX with both a window with a zbuffer and
  226.        a pbuffer that resides in the same bitplanes as that
  227.        zbuffer.  In such a case, glXMakeCurrentReadSGIX will return
  228.        GL_FALSE and fail.
  229.  
  230.  
  231.        6.8  _E_x_a_m_p_l_e__p_b_u_f_f_e_r__b_a_n_k__c_a_l_c_u_l_a_t_i_o_n_s
  232.  
  233.        Note that "overlap" in the table below refers to
  234.        zbuffer/pbuffer overlap.  Such overlap is not allowed in a
  235.        single call to glXMakeCurrentReadSGIX.  Such overlap may
  236.        incur swapping performance penalties.
  237.  
  238.  
  239.        6.8.1  _n_o__o_v_e_r_l_a_p
  240.  
  241.           +o 0 banks window
  242.  
  243.           +o 1 bank  window + z/s buffer
  244.  
  245.           +o 1 bank  window + 12(L) pbuffer
  246.  
  247.           +o 1 bank  window + 8888 pbuffer
  248.  
  249.           +o 2 banks window + (2) 12(L) pbuffers
  250.  
  251.           +o 2 banks window + (2) 8888 pbuffers
  252.  
  253.           +o 2 banks window + 8888 pbuffer + z/s buffer
  254.  
  255.           +o 3 banks window + (2) 8888 pbuffer + z/s buffer
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.                                   - 5 -
  269.  
  270.  
  271.  
  272.           +o 2 banks window + 12/12/12 pbuffer + z/s buffer
  273.  
  274.        6.8.2  _w_i_t_h__o_v_e_r_l_a_p
  275.  
  276.           +o 0 banks window
  277.  
  278.           +o 1 bank  window + z/s buffer
  279.  
  280.           +o 1 bank  window + 12(L) pbuffer
  281.  
  282.           +o 1 bank  window + 8888 pbuffer
  283.  
  284.           +o 2 banks window + (2) 12(L) pbuffers
  285.  
  286.           +o 2 banks window + (2) 8888 pbuffers
  287.  
  288.           +o 1 banks window + 8888 pbuffer + z/s buffer
  289.  
  290.           +o 2 banks window + (2) 8888 pbuffer + z/s buffer
  291.  
  292.           +o 2 banks window + 12/12/12 pbuffer + z/s buffer
  293.  
  294.  
  295.        6.9  _P_b_u_f_f_e_r__b_a_n_k__a_v_a_i_l_a_b_i_l_i_t_y
  296.  
  297.        The framebuffer memory available for pbuffers in Max and
  298.        High Impact systems are organized as follows.  Note that on
  299.        High Impact, the number of banks available for pbuffers
  300.        depends on the timing table which is loaded when the X
  301.        Server starts.
  302.  
  303.  
  304.        6.9.1  _M_a_x__I_m_p_a_c_t
  305.  
  306.           +o normal timing tables: 2 pbuffer banks
  307.  
  308.           +o 1024x768 timing tables: 4 pbuffer banks
  309.  
  310.           +o 1600x1200 timing table: 1 pbuffer bank
  311.  
  312.           +o 1600x1200 32db: none
  313.  
  314.  
  315.        6.9.2  _H_i_g_h__I_m_p_a_c_t__a_n_d__S_o_l_i_d__I_m_p_a_c_t
  316.  
  317.           +o normal timing tables: 1 pbuffer bank
  318.  
  319.           +o 1024x768 timing tables: 1 pbuffer bank
  320.  
  321.           +o 1024x768 pbuf: 2 pbuffer banks
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.                                   - 6 -
  335.  
  336.  
  337.  
  338.           +o 32db timing tables: none
  339.  
  340.           +o 1600x1200 timing table: none
  341.  
  342.  
  343.        6.10  _P_b_u_f_f_e_r__b_a_n_k__u_s_a_g_e
  344.  
  345.        OpenGL pbuffer bank usage:
  346.  
  347.  
  348.        6.10.1  _C_o_l_o_r__b_u_f_f_e_r_s
  349.  
  350.           +o two banks       db 8/8/8/8
  351.  
  352.           +o two banks       db 12/12/12
  353.  
  354.           +o two banks       stereo db (any resolution)
  355.  
  356.           +o one bank        all other color resolutions
  357.  
  358.        6.10.2  _A_n_c_i_l_l_a_r_y__b_u_f_f_e_r_s
  359.  
  360.           +o add one extra bank for visuals with Z and/or stencil
  361.  
  362.  
  363.        N.B.: 12-12-12 color buffers (without depth) are prohibited
  364.        from being allocated in the bitplanes normally used by the
  365.        zbuffer (pbuffer bank 0).  The zbuffer bank will be
  366.        allocated last when you are allocating a series of pbuffers,
  367.        so the simplest workaround is simply to make sure that you
  368.        allocate any 12-12-12 pbuffers before your other pbuffers.
  369.        This restriction will manifest itself as
  370.        glxCreateGLXPbufferSGIX failing due to BadAlloc.
  371.  
  372.  
  373.        6.11  _I_m_p_a_c_t_-_s_p_e_c_i_f_i_c__g_l_X_M_a_k_e_C_u_r_r_e_n_t_R_e_a_d__C_o_m_p_a_t_i_b_i_l_i_t_y
  374.  
  375.           +o 1) Render types must match (color index/rgba).
  376.  
  377.           +o 2) Pbuf with depth & window with depth are
  378.             incompatible.
  379.  
  380.           +o 3) Pbufs in bank 0 and window with z are incompatible.
  381.             (Pbuffers will be put in bank 0 last.)  (Pbuffers
  382.             allocated earlier are not likely to be in bank 0.)
  383.  
  384.           +o 4) Color depths of drawables do NOT need to match.
  385.  
  386.           +o 5) DB/Stereo do NOT need to match.
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.